package pOJ;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/*
input:
12
4873279
ITS-EASY
888-4567
3-10-10-10
888-GLOP
TUT-GLOP
967-11-11
310-GINO
F101010
888-1200
-4-8-7-3-2-7-9-
487-3279

output:
310-1010 2
487-3279 4
888-4567 3


A, B, and C map to 2
D, E, and F map to 3
G, H, and I map to 4
J, K, and L map to 5
M, N, and O map to 6
P, R, and S map to 7
T, U, and V map to 8
W, X, and Y map to 9

12
4873279             487-3279
ITS-EASY            487-3279
888-4567            888-4567
3-10-10-10          310-1010
888-GLOP            888-4567
TUT-GLOP            888-4567
967-11-11           967-1111
310-GINO            310-4466
F101010             310-1010
888-1200            888-1200
-4-8-7-3-2-7-9-     487-3279
487-3279            487-3279


 */

public class Main1002 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner scan = new Scanner(System.in);
        Map<String, Integer> hmap = new HashMap<String, Integer>();
        int num = scan.nextInt();
        for (int i = 0; i < num; i++) {
            String standard = changeToStandard(scan.next());
            hmap.put(standard, hmap.containsKey(standard) ? hmap.get(standard) + 1 : 1);
        }
        Set<String> set = new TreeSet<String>(hmap.keySet());
        boolean flag = false;
        for (String s : set) {
            int value = hmap.get(s);
            if (value > 1) {
                System.out.println(s + " " + value);
                flag = true;
            }
        }
        if (flag == false) {
            System.out.println("No duplicates");
        }
    }

    private static String changeToStandard(String number) {
        // TODO Auto-generated method stub
        /*
        char[] standard = new char[8];
        int index = 0;
        for (int i = 0; i < number.length(); i++) {
            char ch = number.charAt(i);
            if (ch >= '0' && ch <= '9') {
                standard[index++] = ch;
            } else if (ch >= 'A' && ch <= 'C') {
                standard[index++] = 2;
            } else if (ch >= 'D' && ch <= 'F') {
                standard[index++] = 3;
            } else if (ch >= 'G' && ch <= 'I') {
                standard[index++] = 4;
            } else if (ch >= 'J' && ch <= 'L') {
                standard[index++] = 5;
            } else if (ch >= 'M' && ch <= 'O') {
                standard[index++] = 6;
            } else if (ch == 'P' && ch == 'R' && ch == 'S') {
                standard[index++] = 7;
            } else if (ch >= 'T' && ch <= 'V') {
                standard[index++] = 8;
            } else if (ch >= 'W' && ch <= 'Y') {
                standard[index++] = 9;
            }
        }
        return standard.toString();
        */
        String standard = "";
        for (int i = 0; i < number.length(); i++) {
            char ch = number.charAt(i);
            if (ch >= '0' && ch <= '9') {
                standard += ch;
            } else if (ch >= 'A' && ch <= 'C') {
                standard += 2;
            } else if (ch >= 'D' && ch <= 'F') {
                standard += 3;
            } else if (ch >= 'G' && ch <= 'I') {
                standard += 4;
            } else if (ch >= 'J' && ch <= 'L') {
                standard += 5;
            } else if (ch >= 'M' && ch <= 'O') {
                standard += 6;
            } else if (ch == 'P' || ch == 'R' || ch == 'S') {
                standard += 7;
            } else if (ch >= 'T' && ch <= 'V') {
                standard += 8;
            } else if (ch >= 'W' && ch <= 'Y') {
                standard += 9;
            }
        }
        standard = standard.substring(0, 3) + "-" + standard.substring(3, 7);
        return standard;
    }
    
    

}
